package HomeWork.work10;

/**
 * @author banana
 */
public class Work10 {
    public static void main(String[] args) {
        int[] a = {56, 58, 12, 0, 8, 32, 0, 80};
        int i = 0;
        for (int b = 0; b < 8; b++) {
            if (a[b] != 0) {
                i++;
            }
        }
        int[] c = new int[i];
        int d = 0;
        for (int b = 0; b < 8; b++) {
            if (a[b] != 0) {
                c[d] = a[b];
                d++;
            }
        }
        p1(c);
    }

    private static void p1(int[] a) {
        for (int i = 0; i < a.length; i++) {
            System.out.print(a[i] + "\t");
        }
        System.out.println();
    }
}

